import Vue from "vue/dist/vue.esm";

console.log(Vue);
const vm = new Vue({
  el: "#app",
  data: {
    msg: "abc",
  },
  computed: {
    length() {
      console.log("计算属性 length");
      return this.msg.length;
    },
  },
  watch: {
    msg(value) {
      console.log("msg变了", value);
    },
  },
  methods: {
    update() {
      this.msg += "--";
    },
  },
  render: function (h) {
    let vnode = (
      <div>
        <p>msg: {this.msg}</p>
        <p>length: {this.length}</p>
        <button onClick={this.update}>更新</button>
      </div>
    );
    return vnode;
  },
});
// console.log(vm);

/*
  data:{
    name:'tom',
    age:20
  }
  [name,age]

  object.defineproperty(data,name,{})

*/
